﻿/*
 Copyright (c) 2006 - 2007 Eric J. Feminella  <eric@ericfeminella.com>
 All rights reserved.

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is furnished
 to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in all
 copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 @internal
 */

package com.ericfeminella.control{
	/**
	     *
	     * Provides a mechanism which facilitates view notification 
	     * for CairngormEvent sub-classes which must dispatch result 
	     * and fault events from which views of interest can register 
	     * listeners and respond accordingly
	     *
	     * <p>
	     * clients are to Implement this interface when a command needs
	     * to notify a view or multiple views once Event processing and
	     * service result / fault handlers have been invoked.
	     * </p>
	     *
	     * <p>
	     * IViewNotifierEvent provides an interface to the conceptual 
	     * view notification mechanism which can be found at:
	     * http://tech.groups.yahoo.com/group/cairngorm-documentation/message/221
	     * </p>
	     *
	     * @example An example implementation is as follows:
	     *
	     * <listing version="3.0" >
	     *
	     * package
	     * {
	     *    import com.adobe.cairngorm.control.CairngormEvent;
	     *
	     *    public class SampleEvent extends CairngormEvent implements IViewNotifierEvent
	     *    {
	     *       public static const SAMPLE_EVENT:String        = "sample-event";
	     *       public static const SAMPLE_EVENT_RESULT:String = "sample-result";
	     *       public static const SAMPLE_EVENT_FAULT:String  = "sample-fault";
	     *
	     *       public function SampleEvent(type:String = null)
	     *       {
	     *           super( type );
	     *       }
	     *
	     *       public function dispatchResult() : void
	     *       {
	     *           new SampleEvent( SAMPLE_EVENT_RESULT ).dispatch();
	     *       }
	     *
	     *       public function dispatchFault() : void
	     *       {
	     *           new SampleEvent( SAMPLE_EVENT_FAULT ).dispatch();
	     *       }
	     *    }
	     * }
	     * </listing>
	     *
	     */
	public interface IViewNotifierEvent {
		/**
		         * 
		         * Handles a CairngormEvent result by re-dispatching the event
		         * type back into the event flow
		         * 
		         */
		function dispatchResult():void;

		/**
		         * 
		         * Handles a CairngormEvent fault by re-dispatching the event
		         * type back into the event flow
		         * 
		         */
		function dispatchFault():void;
	}
}